package com.example.service.impl;

import com.example.entity.Comment;
import com.example.repository.CommentRepository;
import com.example.service.CommentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {


    @Resource
    private CommentRepository commentRepository;

    @Override
    public List<Comment> findByArticleId(int id) {
        List<Comment> commentByArticle = commentRepository.findByArticleId(id);
        return commentByArticle;
    }
}
